CREATE TABLE  "CDS" 
   (	"ID" NUMBER, 
	"NOME" VARCHAR2(100) NOT NULL ENABLE, 	 
	"GRAVADORA" VARCHAR2(100) NOT NULL ENABLE, 
	"EDICAO" DATE NOT NULL ENABLE, 
	 CONSTRAINT "CDS_PK" PRIMARY KEY ("ID") ENABLE
   )
/

CREATE SEQUENCE CDS_SEQ
  INCREMENT BY 1
  MAXVALUE 1000
  NOCACHE
  NOCYCLE

/

CREATE OR REPLACE TRIGGER  "BI_CDS" 
  before insert on "CDS"               
  for each row  
begin   
    select "CDS_SEQ".nextval into :NEW.ID from dual; 
end; 

/
ALTER TRIGGER  "BI_CDS" ENABLE
/

COMMIT
/
